package com.edu.admin.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.edu.admin.service.ClassesService;

/**
 * 
 * 
 * @author Wangjiong
 * 
 */
@Component
public class ScheduledController {
	private static final Logger log = LoggerFactory.getLogger(ScheduledController.class);
	@Autowired
	ClassesService classesService;
	
	// 每年8月1日00:05:00进行学年升班批处理
	@Scheduled(cron = "0 5 0 1 8 ?")
	public void schoolUpgrading() throws Exception{
	    log.info("start School-upgrading scheduled!");
	    classesService.schoolUpgrading(null);
	    log.info("end School-upgrading scheduled!");
	}

}
